package com.lechi.web.system.service.impl;

import com.lechi.web.system.domain.IotGreenhouseBo;
import com.lechi.web.system.mapper.iot.IotGreenhouseMapper;
import com.lechi.web.system.service.IIotGreenhouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 大棚Service业务层处理
 *
 * @author yangguang
 * @date 2025-07-21
 */
@Service
public class IotGreenhouseServiceImpl implements IIotGreenhouseService {

    @Autowired
    private IotGreenhouseMapper iotGreenhouseMapper;

    /**
     * 查询大棚
     *
     * @param id 大棚主键
     * @return 大棚
     */
    @Override
    public IotGreenhouseBo selectIotGreenhouseById(Long id) {
        return iotGreenhouseMapper.selectIotGreenhouseById(id);
    }

    /**
     * 查询大棚列表
     *
     * @param iotGreenhouse 大棚
     * @return 大棚
     */
    @Override
    public List<IotGreenhouseBo> selectIotGreenhouseList(IotGreenhouseBo iotGreenhouse) {
        return iotGreenhouseMapper.selectIotGreenhouseList(iotGreenhouse);
    }

    /**
     * 新增大棚
     *
     * @param iotGreenhouse 大棚
     * @return 结果
     */
    @Override
    public int insertIotGreenhouse(IotGreenhouseBo iotGreenhouse) {
            return iotGreenhouseMapper.insertIotGreenhouse(iotGreenhouse);
    }

    /**
     * 修改大棚
     *
     * @param iotGreenhouse 大棚
     * @return 结果
     */
    @Override
    public int updateIotGreenhouse(IotGreenhouseBo iotGreenhouse) {
        return iotGreenhouseMapper.updateIotGreenhouse(iotGreenhouse);
    }

    /**
     * 批量删除大棚
     *
     * @param ids 需要删除的大棚主键
     * @return 结果
     */
    @Override
    public int deleteIotGreenhouseByIds(Long[] ids) {
        return iotGreenhouseMapper.deleteIotGreenhouseByIds(ids);
    }

    /**
     * 删除大棚信息
     *
     * @param id 大棚主键
     * @return 结果
     */
    @Override
    public int deleteIotGreenhouseById(Long id) {
        return iotGreenhouseMapper.deleteIotGreenhouseById(id);
    }
}
